


(defproto expert-menu-item-proto () () menu-item-proto)


(defmeth expert-menu-item-proto :do-action ()
(print "HILO")
  (cond
    ((not (send *vista* :show-help))
     (when (and (equal $$$ @)
                (member (send self :menu)
                        (list *data-menu* *trans-menu* *spreadplot-menu* 
                              *graphics-menu* *analyze-menu*)))
           (setcd (first (send @ :dob-parents))))
     (when (author) (copyitem (send self :title)))
     (when (send self :action) (funcall (send self :action))))
    (t
     (unless (ignore-errors (send *workmap* :show-help self))
             (send *vista* :show-help nil)
             (cond 
               (*print-help-mode* 
                (send *help-window* :close)
                (send *desktop-container* :resize))
               (t
                (no-help.hlp)
                ;(one-button-dialog 
                ; "I'm sorry, but there is no help for this menu item."
                ; :title "Help: Missing Help File"
                ; :first-button "Oops ... My mistake :-(")
                (top-level nil)))))
    ))


;vismenu1

(defproto vista-menu-item-proto '(ok-data=types) () expert-menu-item-proto)

(defmeth vista-menu-item-proto :ok-data-types (&optional (list nil set))
  (if set (setf (slot-value 'ok-data=types) list))
  (slot-value 'ok-data=types))

(defmeth vista-menu-item-proto :isnew 
  (title &key (enabled t) (action nil) (ok-data-types) (mark nil))
  (send self :ok-data-types ok-data-types)
  (call-next-method title :enabled enabled :action action :mark mark))

(defmeth vista-menu-item-proto :do-action () (print "UPHI") (call-next-method))

#|(defmeth vista-menu-item-proto :do-action () 
  (cond
    ((not (send *vista* :show-help))
     (when (and (equal $$$ @)
                (member (send self :menu)
                        (list *data-menu* *trans-menu* *spreadplot-menu* 
                              *graphics-menu* *analyze-menu*)))
           (setcd (first (send @ :dob-parents))))
     (when (author) (copyitem (send self :title)))
     (when (send self :action) (funcall (send self :action))))
    (t
     (unless (ignore-errors (send *workmap* :show-help self))
             (send *vista* :show-help nil)
             (cond 
               (*print-help-mode* 
                (send *help-window* :close)
                (send *desktop-container* :resize))
               (t
                (one-button-dialog 
                 "I'm sorry, but there is no help for this menu item."
                 :title "Help: Missing Help File"
                 :first-button "Oops ... My mistake :-(")
                (top-level nil)))))
    ))|#


(defmeth menu-proto :set-vista-menu-item-states (dob)
  (cond
    (dob
     (send self :enabled t)
     (mapcar #'(lambda (item)
              (unless (equal (send item :title) "-")
                      (if 
                       (member (send dob :generalized-datatype) 
                               (send item :ok-data-types) :test #'equal)
                       (send item :enabled t)
                       (send item :enabled nil))))
          (send self :items)))
    (t
     (send self :enabled nil)))
  (send self :enabled))